/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.projetoObras.view;

import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author Tiago
 */
public class WorkRegistryView extends javax.swing.JPanel {

    /**
     * Creates new form VisaoCadastroObra
     */
    private MainFrame m_frame;
    private ImageRegistryView m_image;
    private MeasureRegistryView m_measure;
    private RestorationRegistryView m_restoration;
    
    
    public WorkRegistryView(MainFrame frame) {
        initComponents();
        m_frame = frame;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lbl_year_position_series = new javax.swing.JLabel();
        txt_year_position_series = new javax.swing.JTextField();
        lbl_collection = new javax.swing.JLabel();
        txt_collection = new javax.swing.JTextField();
        lbl_artist = new javax.swing.JLabel();
        txt_artist = new javax.swing.JTextField();
        lbl_title = new javax.swing.JLabel();
        lbl_year = new javax.swing.JLabel();
        lbl_technique = new javax.swing.JLabel();
        txt_title = new javax.swing.JTextField();
        txt_year = new javax.swing.JTextField();
        txt_technique = new javax.swing.JTextField();
        lbl_dimension = new javax.swing.JLabel();
        txt_dimension = new javax.swing.JTextField();
        lbl_signature_place = new javax.swing.JLabel();
        txt_signature_place = new javax.swing.JTextField();
        lbl_origin = new javax.swing.JLabel();
        txt_origin = new javax.swing.JTextField();
        lbl_acquisition = new javax.swing.JLabel();
        txt_acquisition = new javax.swing.JTextField();
        lbl_conservation = new javax.swing.JLabel();
        txt_conservation = new javax.swing.JTextField();
        lbl_documentation = new javax.swing.JLabel();
        txt_documentation = new javax.swing.JTextField();
        btn_save = new javax.swing.JButton();
        btn_clear = new javax.swing.JButton();
        btn_image = new javax.swing.JButton();
        btn_measure = new javax.swing.JButton();
        btn_restoration = new javax.swing.JButton();
        lbl_picture = new javax.swing.JLabel();
        txt_picture = new javax.swing.JTextField();
        btn_search_picture = new javax.swing.JButton();

        lbl_year_position_series.setText("Ano/Posição/Série");

        lbl_collection.setText("Coleção");

        lbl_artist.setText("Artista");

        lbl_title.setText("Título");

        lbl_year.setText("Ano");

        lbl_technique.setText("Técnica");

        lbl_dimension.setText("Dimensões");

        lbl_signature_place.setText("Local da Assinatura");

        lbl_origin.setText("Procedência");

        lbl_acquisition.setText("Aquisição");

        lbl_conservation.setText("Conservação");

        lbl_documentation.setText("Documentação");

        btn_save.setText("Salvar");

        btn_clear.setText("Limpar");
        btn_clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_clearActionPerformed(evt);
            }
        });

        btn_image.setText("Imagem");
        btn_image.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_imageActionPerformed(evt);
            }
        });

        btn_measure.setText("Medidas");
        btn_measure.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_measureActionPerformed(evt);
            }
        });

        btn_restoration.setText("Restauração");
        btn_restoration.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_restorationActionPerformed(evt);
            }
        });

        lbl_picture.setText("Foto");

        btn_search_picture.setText("Buscar");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbl_picture)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btn_image, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_measure, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_restoration))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(70, 70, 70)
                        .addComponent(btn_save)
                        .addGap(18, 18, 18)
                        .addComponent(btn_clear))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbl_acquisition)
                            .addComponent(txt_acquisition, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(16, 16, 16)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbl_conservation)
                            .addComponent(txt_conservation, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(lbl_documentation, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txt_documentation)))
                    .addComponent(lbl_dimension)
                    .addComponent(lbl_artist)
                    .addComponent(lbl_collection)
                    .addComponent(lbl_year_position_series)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txt_signature_place)
                            .addComponent(lbl_signature_place, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbl_origin)
                            .addComponent(txt_origin, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(txt_artist, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(lbl_title)
                            .addGap(75, 75, 75)
                            .addComponent(lbl_year)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lbl_technique))
                        .addComponent(txt_collection, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(txt_title, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(txt_year, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txt_technique, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(txt_dimension, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_year_position_series, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(txt_picture, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btn_search_picture)))
                .addGap(0, 102, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(lbl_year_position_series)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txt_year_position_series, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbl_collection)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txt_collection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbl_artist)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txt_artist, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_title)
                    .addComponent(lbl_year)
                    .addComponent(lbl_technique))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_title, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_year, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_technique, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbl_dimension)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txt_dimension, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_signature_place)
                    .addComponent(lbl_origin))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_signature_place, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_origin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_acquisition)
                    .addComponent(lbl_conservation)
                    .addComponent(lbl_documentation))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txt_documentation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txt_acquisition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txt_conservation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbl_picture)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_picture, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btn_search_picture))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_image, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btn_measure, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btn_restoration, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_save)
                    .addComponent(btn_clear))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btn_imageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_imageActionPerformed
        m_image = new ImageRegistryView(m_frame);
        m_frame.getMain_panel().add(m_image,BorderLayout.LINE_START);
        m_frame.repaint();
        m_frame.show();
        
    }//GEN-LAST:event_btn_imageActionPerformed

    private void btn_measureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_measureActionPerformed
        m_measure = new MeasureRegistryView(m_frame);
        m_frame.getMain_panel().add(m_measure,BorderLayout.LINE_START);
        m_frame.repaint();
        m_frame.show();
    }//GEN-LAST:event_btn_measureActionPerformed

    private void btn_restorationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_restorationActionPerformed
        m_restoration = new RestorationRegistryView(m_frame);
        m_frame.getMain_panel().add(m_restoration,BorderLayout.LINE_START);
        m_frame.repaint();
        m_frame.show();
    }//GEN-LAST:event_btn_restorationActionPerformed

    private void btn_clearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_clearActionPerformed
        clear();
    }//GEN-LAST:event_btn_clearActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_clear;
    private javax.swing.JButton btn_image;
    private javax.swing.JButton btn_measure;
    private javax.swing.JButton btn_restoration;
    private javax.swing.JButton btn_save;
    private javax.swing.JButton btn_search_picture;
    private javax.swing.JLabel lbl_acquisition;
    private javax.swing.JLabel lbl_artist;
    private javax.swing.JLabel lbl_collection;
    private javax.swing.JLabel lbl_conservation;
    private javax.swing.JLabel lbl_dimension;
    private javax.swing.JLabel lbl_documentation;
    private javax.swing.JLabel lbl_origin;
    private javax.swing.JLabel lbl_picture;
    private javax.swing.JLabel lbl_signature_place;
    private javax.swing.JLabel lbl_technique;
    private javax.swing.JLabel lbl_title;
    private javax.swing.JLabel lbl_year;
    private javax.swing.JLabel lbl_year_position_series;
    private javax.swing.JTextField txt_acquisition;
    private javax.swing.JTextField txt_artist;
    private javax.swing.JTextField txt_collection;
    private javax.swing.JTextField txt_conservation;
    private javax.swing.JTextField txt_dimension;
    private javax.swing.JTextField txt_documentation;
    private javax.swing.JTextField txt_origin;
    private javax.swing.JTextField txt_picture;
    private javax.swing.JTextField txt_signature_place;
    private javax.swing.JTextField txt_technique;
    private javax.swing.JTextField txt_title;
    private javax.swing.JTextField txt_year;
    private javax.swing.JTextField txt_year_position_series;
    // End of variables declaration//GEN-END:variables

    public void clear(){
        txt_acquisition.setText(null);
        txt_artist.setText(null);
        txt_collection.setText(null);
        txt_conservation.setText(null);
        txt_dimension.setText(null);
        txt_documentation.setText(null);
        txt_origin.setText(null);
        txt_signature_place.setText(null);
        txt_technique.setText(null);
        txt_title.setText(null);
        txt_year.setText(null);
        txt_year_position_series.setText(null);
    }
}
